import random


def generate_code(code_len=4):
    
    all_chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'

    last_pos = len(all_chars) - 1

    code = ''

    for _ in range(code_len):

        index = random.randint(0, last_pos)

        code += all_chars[index]

    return code

 

 

random_code = generate_code()

print(random_code)